﻿@using Newtonsoft.Json.Linq
@{
    ViewData["Title"] = "Profile";
}
<h2>@ViewData["Title"]</h2>
<h3>@ViewData["Message"]</h3>

<h2>
    This  page shows information about the user obtained from Microsoft Graph.
</h2>
<p><img src="~/images/CallGroups.png" height="280" width="480" /></p>


<table class="table table-striped table-condensed" style="font-family: monospace">
    <tr>
        <th>Property</th>
        <th>Value</th>
    </tr>
    <tr>
        <td>photo</td>
        <td>
            @{
                if (ViewData["Photo"] != null)
                {
                    <img style="margin: 5px 0; width: 150px" src="data:image/jpeg;base64, @ViewData["Photo"]" />
                }
                else
                {
                    <h3>NO PHOTO</h3>
                    <p>Check user profile in Azure Active Directory to add a photo.</p>
                }
            }
        </td>
    </tr>
</table>
@{
    var user = ViewData["Me"] as Microsoft.Graph.User;
}
<table class="table table-bordered table-striped">
    <tr>
        <td>Display Name</td>
        <td>@user.DisplayName</td>
    </tr>
    <tr>
        <td>First Name</td>
        <td>@user.GivenName</td>
    </tr>
    <tr>
        <td>Last Name</td>
        <td>@user.Surname</td>
    </tr>
</table>

